package com.ympc.service.impl;

import com.ympc.mapper.PPTMapper;
import com.ympc.pojo.PPT;
import com.ympc.service.PPTService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PPTServiceImpl implements PPTService {
    
    @Resource
    private PPTMapper pptMapper;
    
    @Override
    public List<PPT> getPPTsByTeacherId(Integer teacherId) {
        return pptMapper.findByTeacherId(teacherId);
    }
    
    @Override
    public PPT getPPTById(Integer id) {
        return pptMapper.findById(id);
    }
    
    @Override
    public boolean createPPT(PPT ppt) {
        return pptMapper.insertPPT(ppt) > 0;
    }
    
    @Override
    public boolean deletePPT(Integer id) {
        return pptMapper.deletePPT(id) > 0;
    }
}

